package cn.tedu.spring.example;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

/**
 * 1.Controller注解:控制器层,负责接收请求返回响应;
 * 2.service注解:业务逻辑层,负责业务逻辑处理;
 * 3.Repository注解:数据访问层,负责数据处理;
 * 4.component注解:不分层,标识为一个普通的Spring组件.
 *
 * 一个注解都不加,抛出:NoSuchBeanDefinitionException异常;
 *
 */
//@Service
//@Controller
//@Repository
@Component
public class User {
    public void run(){
        System.out.println("Hello world");
    }
}
